/**
 * My first C Kernel :-)
 *
 */
#include "multiboot.h"

.text

.globl start
.extern kernel_main

start:

	jmp multiboot_entry

	.align 4

multiboot_header:

	/* magic */
	.long   MULTIBOOT_HEADER_MAGIC
	/* flags */
	.long   MULTIBOOT_HEADER_FLAGS
	/* checksum */
	.long   -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)

multiboot_entry:

	movl $(stack + STACK_SIZE), %esp

	/* address of multiboot struct */
	push %ebx

	/* magic value */
	push %eax


	/* and finally, call C code! yeah!!! */
	call EXT_C(kernel_main)


	/* just for sanity :-) */
	hlt
loop:
	jmp loop


.bss
	.comm stack,STACK_SIZE

